home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programmer's Power Pack
/
Delphi Volume 1.iso
/
s_to_z
/
tmmplot
/
tmmplot.txt
< prev
Wrap
Text File
|
1996-09-15
|
12KB
|
272 lines
TMMPlot
This Delphi-Component allows the user to easily display a HPGL/2-plot on a form,
paintbox or printer canvas. Free definable pencolors.
The functionality is comparable to the mediaplayer. The component has no own
canvas but needs a canvas to display the graphics. Pencolors and penstyles are
set automatically, other canvasoptions have to be preset.
Advanced Version includes zoom & pan and zoom-to-printer.
Professional Version includes print-2-scale and send-to-plotter.
LIST OF FILES.
File Description
TMMPlot.TXT Software Documentation (this file).
TMMPlot.REG Registration form.
TMMPlot.DCU Component object code.
TMMPlot.DCR Component resource file.
MMPLOT.DLL DLL required from TMMPLOT and MMPlot.EXE
MMPlot.ini You can determine in which page of the gallery TMMPlot
is to be installed.
(It is recommended to copy MMPlot.DLL and MMPlot.ini into your WINDOWS or
SYSTEM directory)
DEMO.DPR Demo project file
DEMO.RES Demo project resource file
MAIN.PAS Demo unit
MAIN.DFM Demo form
SAMPLE.PLT Demo-Plotfile.
eventually:
MMPlot.EXE Viewer based on TMMPLOT
MMPlot.TXT Software Documentation (Viewer).
PROPERTIES
-Published-
Active: boolean Active=true opens a file and projection is enabled.
Display: tpaintbox The projector screen can be selected. If no paintbox is
available/selected, the parent form will be the display.
DitherOfs:integer Correction offset to fix dithering density
PenWidthfactor:integer Correction factor to fix penwidths
Default = 4 --> PW0.25 * 4 = 1 pixel
GraphDir, GraphName: string Plotdirectory and HPGL-Sourcefile
IsOpen:boolean Plotfile was opened
IsZoomed:boolean Zoom active
IsPanned:boolean Pan active
MapMode: TMapMode Show Plot in isotropic/anisotropic mode
Name: TComponentname
Options: TGraphOptions Various graphic options can be set as there are:
[**] goPrint : Output to Printer
[**] goOrigScale : Print in original scale
[**] goGrid : Display pageframes on screen.
[**] goPageNums : Print Pagenumbers on the different sheets.
[**] goBlackprint : Print using black pen for all colors.
Startpage, Endpage, PrintCopies: word
[**] See TReport....
Painttiming: TPaintTiming
This depicts when the OnPaint-eventhandling will be
executed in relation to Display.OnPaint.
Possible values are:
ptBefore : Before Display.OnPaint
ptReplace: Instead of Display.OnPaint
ptAfter : After Display.OnPaint
Pen1...Pen8: tcolor colors for plotter-pens no 1 to 8
Pencolor[Index:Integer]:tColor up to 255 pencolors can be set
BackGnd:Tcolor Backgroundcolor used for dithered fill
Port: TMMComm You can assign a communication port of the TMMComm or
derived classes. If no Port is assigned, TMMPlot will create
its own, using default parameter,if necessary.
Title:string Title displayed in printmanager
-Public-
Version : string RevisionCode ( 16.02e = 16bit-revision 2-english )
Error : string Display Errortext and clear it (if any)
Filename: string HPGL-file with complete path
Blackprint : boolean All printer output will use black pen & brush
DirecttoPort: boolean if TRUE : Send directly to local port specified by portname (WriteComm),
if FALSE: File will be copied to destination file or port.
Destination : string filename to copy the file to, may also be a port name (not under WinNT)
PortName : string For Example: "COM3:"
BaudRate : TBaudRate = (br110, br300, br600, br1200, br2400, br4800, br9600, br14400,
br19200, br38400, br56000, br128000, br256000);
ParityBits : TParityBits = (pbNone, pbOdd, pbEven, pbMark, pbSpace);
DataBits : TDataBits = (dbFour, dbFive, dbSix, dbSeven, dbEight);
StopBits : TStopBits = (sbOne, sbOnePointFive, sbTwo);
FlowControl : TFlowControl = (fcNone, fcRTSCTS, fcXONXOFF);
METHODS
constructor Create(AOwner: TComponent);
destructor Free;
procedure Close; Deactivate, Close Plotfile
procedure ZoomAll; Reset Zoom, Refresh
procedure SetZoom( r : trect ); Zoom-In
procedure Pan ( r : trect ); Pan
function SaveFileAs(newname:tfilename):boolean; Save Plotdata in binary file
Returns TRUE if ERROR !!!
procedure Hardcopy; Hardcopy in actual mode
function Send:boolean; Send or copy to plotter/printer port or file
procedure SetDefPal_255; Set System default palette colors
procedure SetACADPal_9; Set Pen 1..9 Autocad colors
procedure SetStdPal_8;
function Size( Var mmx,mmy : longint;
Var PageCount : word
):boolean; { true = ERROR }
Returns the Dimensions of the Plot and the amount of printer pages
it would take to print the whole thing in original scale.
function Info( p : pPlotInfo ):boolean;
Provides more details concerning the plot in the following structure:
plotInfo = ^tPlotInfo; { pointer on struct }
type tPlotInfo = record
mmx, mmy, { Dim [mm] }
plxmax, { Max x [plotunit] }
plymax, { Max y [plotunit] }
plxmin, { Min x [plotunit] }
plymin : longint; { Min y [plotunit] }
penbuf : array[0..255] of byte; { used pens (penbuf[0]=highest penNr) }
{ penbuff[i] > 0 = pen i used }
pages : word; { required page# on actual printer }
end;
procedure GetPortsAvail( SerialOnly: boolean; List: TStrings );
Fills a string list with the names of the currently available ports
procedure orientate(r:real); Rotate: r=0░/90░/180░/270░
EVENTS
OnActivate
OnDeactivate
OnFileOpen File will be opened on first activation or on a call
to .Size or .Info method.
OnPaint Paint event, hooked into display's paintevent
See property painttiming.
Installing TMMPlot
To install this VCL, copy both MMPlot.DCU and MMPlot.DCR to the
directory where you have your other shareware controls. Then,
from Delphi's main menu, select Options|Install Components. In the
dialog, click on the Add... button, then Browse... and change to the
drive/directory where you stored the above two files. Select
MMPlot.DCU and click OK, then OK again.
Copy MMPLOT.DLL into Your outputdirectory for your EXE or DLL or to
Your Windows or System directory (recommended for Designers).
The component needs MMPLOT.DLL to interpret HPGL-files. The DLL
is dynamically loaded and may not be needed if the plot is "precompiled".
See section below for more information.
You can copy MMPlot.INI into your Windows directory to Determine into
which gallery page the component(s) should be installed.
Using TMMPlot
To use this control, simply place it on your form, and edit the
Graphname, Options, Pens and Display properties.
If you have the pro version and place a TMMComm or derived component
on the Form, you can select is as the port property for a TMMPlot.
You can use TMMPLOT without MMPLOT.DLL in certain circumstances. The DLL is
loaded dynamically when the first HPGLfile is opened.
Raw graphic data is saved in a temporary binary file (Property FFil